#pragma once

#include "precomp.h"
#include "Lander.h"

//game logic for connect four
class GameLogic
{
protected:
	int timer;
	
	enum GameState {RUN, LANDED, CRASHED};
	GameState gameState;
	bool debugOn;

	CL_Font_System smallFont;
	CL_Font_System largeFont;

	Lander lander;
	int floor;
	int displayScoreTiming;
	int maxCollisionSpeed;

	int platform1, platform2; //stores the x coordinates of the platform 

public:
	int width, height; //width and height of the screen
	GameLogic(void);
	~GameLogic(void);

	void init(CL_GraphicContext& gc);
	void reset();
	void landed();
	
	//void userInput(CL_InputDevice keyboard, CL_InputDevice mouse);
	void mouseDown(const CL_InputEvent &event, const CL_InputState &state);
	void keyDown(const CL_InputEvent &event, const CL_InputState &state);
	void keyUp(const CL_InputEvent &event, const CL_InputState &state);

	//update calls userinput
	//void update(int delta, CL_InputDevice keyboard, CL_InputDevice mouse);
	void update(int delta);
	void draw(CL_GraphicContext& gc);
	void collisions();

	void drawWorld(CL_GraphicContext& gc);
};

